Registry Guide for Windows Registry Guide for Windows
Part of the WinGuides Network
WinGuides Network and Software
Registry tweaks, tricks & hacks to optimize, enhance and secure Microsoft Windows.

Enable Delayed Environment Variable Expansion (Windows 2000/XP)
Category: Home > Windows > Accessories > Command Processor

Download this tweak with Tweak Manager!This tweak can be easily applied using WinGuides Tweak Manager.
Download a free trial now!

This setting allows you to enable or disable delayed environment variable expansion in the command processor. If this feature is enabled then exclaimation characters can be used to substitute the value of an environment variable at execution time.

Open your registry and find the key below.

Create a new DWORD value called "DelayedExpansion" and set it to equal "1" to enabled variable expansion or "0" to disable it.

Delayed expansion will be available the next time the command processor is used. To access variables surround the variable name with exclaimation characters i.e. "!varname!". For example to echo the PATH variable you could use the following command:

echo !path!

Registry Editor Example
|NameTypeData|
|(Default)REG_SZ(value not set)|
|DelayedExpansionREG_DWORD0x00000001 (1)|
-
|HKEY_CURRENT_USER\Software\Microsoft\Command Processor|
-

Settings:
User Key: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
Name: DelayedExpansion
Type: REG_DWORD (DWORD Value)
Value: (0 = disabled, 1 = enabled)

Disclaimer: Modifying the registry can cause serious problems that may require you to reinstall your operating system. We cannot guarantee that problems resulting from modifications to the registry can be solved. Use the information provided at your own risk.

Last Modified: March 8, 2001

 Return to Index Copyright © 1998-2003. All Rights Reserved.  License